
$(function () {
    $(".post-btn").click(function (event) {
        event.preventDefault();
        var self = $(this)
        var tr = self.parent().parent()
        var post_id = tr.attr("data-post-id")
        var highTag = parseInt(tr.attr("data-high-tag"))
        var url = ""
        if(highTag){
            url = "/cms/ulight/";
        }else{
            url = "/cms/alight/";
        };
        zlajax.post({
            "url": url,
            "data":{
                "post_id": post_id
            },
            "success":function (data) {
                if(data["code"]==200){
                    xtalert.alertSuccessToast("操作成功!");
                    setTimeout(function () {
                        window.location.reload()
                    },500)
                }else {
                    xtalert.alertErrorToast(data["message"])
                }
            }
        })


        var url = ""



    })
})